package top.lwaiting.controller;


import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import top.lwaiting.bean.ProductBean;
import top.lwaiting.service.ProductService;

/**
 * 商品管理
 * @author YangSong
 */
@RestController
public class ProductController {

    @Resource
    ProductService productService;

    /**
     * 查询商品
     * @param productId {@link Long} 商品id
     */
    @GetMapping("/product/{id}")
    public ProductBean getProduct(@PathVariable("id") Long productId) {
        ProductBean product = productService.getProductById(productId);
        return product;
    }
}
